To print the answers

At the place in the document where you want the answers printed, put

\doanswers

You can put this any place after the last batch of exercises. This will produce an unnumbered section titled ``Solutions'', followed by the solutions to the problems in each section. (The once option will not produce a section title, although it will print the answers.) When using book.sty, the section of answers will be formatted as an unnumbered chapter, therefore starting on a new page. In article.sty, the answer section will not start on a new page. If you want it to, type newpage before doanswers. If you want the page numbers to start over, type

\newpage
\setcounter{page}{1}

You could then bind the answer section as a separate document.

The command dosolutions prints the answers you wrote to exercises that are not marked as having answers. Normally, you would set the page counter to 1 as above before invoking dosolutions. This article does this, as you can see by examining the source code.